package com.dynamicAgent;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * Project: tobe-better-coder
 * Package: com.dynamicAgent
 *
 * @author : Mr.xu
 * @date : 2023/3/25 5:06
 */
public class InvocationHandlerDemo<T> implements InvocationHandler {
    private T target;

    public InvocationHandlerDemo(T target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        Object result = method.invoke(target, args);
        return result;
    }
}